# -*- coding: utf-8 -*-
import os
import multiprocessing

# gevent 的猴子补丁
from gevent import monkey

monkey.patch_all()

path_of_current_dir = os.getcwd()

logs_path = "{}/logs".format(path_of_current_dir)
if not os.path.exists(logs_path):
    os.makedirs(logs_path)

_file_name = "gunicorn"

bind = "0.0.0.0:8000"
workers = multiprocessing.cpu_count()
worker_class = "gevent"
timeout = 100
limit_request_line = 8188

loglevel = "info"

access_log_format = '%({X_Real_IP}i)s %(l)s %(t)s "%(r)s" %(s)s %(b)s "%(a)s" %(D)sms'
pidfile = "%s/%s.pid" % (logs_path, _file_name)
errorlog = "%s/%s_error.log" % (logs_path, _file_name)
accesslog = "%s/%s_access.log" % (logs_path, _file_name)

# gunicorn -c gunicorn.py app.wsgi:application --preload
